﻿package net.wangit.util;

import java.awt.image.BufferedImage;
import java.io.InputStream;

import javax.imageio.ImageIO;

public class ImageUtil {

	public ImageUtil() {
	}

	public static int getMaxSize(InputStream is) throws Exception {
		BufferedImage sourceImg = ImageIO.read(is);
		int width = sourceImg.getWidth();
		int height = sourceImg.getHeight();
		System.out.println((new StringBuilder("width=")).append(width).append(
				" height=").append(height).toString());
		return width <= height ? height : width;
	}
}
